package com.taobao.txc.datasource.cobar;

import com.alibaba.druid.pool.DruidDataSource;
import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.b.e;
import java.io.PrintWriter;
import java.sql.Connection;
import java.util.logging.Logger;
import javax.sql.DataSource;

public class TxcDataSource
  implements com.taobao.txc.resourcemanager.b.a.b
{
  private static final LoggerWrap a = LoggerInit.logger;
  private final DruidDataSource b;
  private volatile boolean c = false;
  private final com.taobao.txc.resourcemanager.b.b d = new com.taobao.txc.resourcemanager.b.b();
  private String e = "SELECT 'x'";
  
  public TxcDataSource()
  {
    DruidDataSource localDruidDataSource = new DruidDataSource();
    localDruidDataSource.setValidationQuery(this.e);
    this.b = localDruidDataSource;
  }
  
  public TxcDataSource(DruidDataSource paramDruidDataSource)
  {
    this.b = paramDruidDataSource;
  }
  
  public Connection getConnection()
  {
    if (!this.c) {
      synchronized (this)
      {
        if (!this.c)
        {
          String str = b();
          this.d.a(this, str, null);
          a.info("TxcDataSource:[" + str + "] init success.");
          this.c = true;
        }
      }
    }
    ??? = this.b.getConnection();
    return new a((Connection)???, this);
  }
  
  public DataSource a()
  {
    return this.b;
  }
  
  public Connection getConnection(String paramString1, String paramString2)
  {
    throw new e();
  }
  
  public PrintWriter getLogWriter()
  {
    return this.b.getLogWriter();
  }
  
  public void setLogWriter(PrintWriter paramPrintWriter)
  {
    this.b.setLogWriter(paramPrintWriter);
  }
  
  public void setLoginTimeout(int paramInt)
  {
    this.b.setLoginTimeout(paramInt);
  }
  
  public int getLoginTimeout()
  {
    return this.b.getLoginTimeout();
  }
  
  public Logger getParentLogger()
  {
    return this.b.getParentLogger();
  }
  
  public <T> T unwrap(Class<T> paramClass)
  {
    return this.b.unwrap(paramClass);
  }
  
  public boolean isWrapperFor(Class<?> paramClass)
  {
    return this.b.isWrapperFor(paramClass);
  }
  
  public void setDriverClassName(String paramString)
  {
    this.b.setDriverClassName(paramString);
  }
  
  public void setUrl(String paramString)
  {
    this.b.setUrl(paramString);
  }
  
  public void setUsername(String paramString)
  {
    this.b.setUsername(paramString);
  }
  
  public void setPassword(String paramString)
  {
    this.b.setPassword(paramString);
  }
  
  public String b()
  {
    return String.format("%s", new Object[] { this.b.getUrl() });
  }
  
  public String c()
  {
    return System.getProperty("appName");
  }
  
  public String d()
  {
    return System.getProperty("schemaName");
  }
  
  public String e()
  {
    return null;
  }
  
  public void setValidateQuery(String paramString)
  {
    this.e = paramString;
    this.b.setValidationQuery(paramString);
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.datasource.cobar.TxcDataSource
 * JD-Core Version:    0.7.0.1
 */